<extend name="Home@Base/common" />
<block name="body">
  <div class="span9 page_message">
    <section id="contents"> 
      <include file="Home@Addons/_nav" /> 
      <div class="table-bar">
        <!-- 多维过滤 -->
        <form class="muti_search cf" style="border-top:none">
          <div class="" style="line-height: 30px;">
          <span>扫码时间：</span>
             <input type="datetime" name="start_time" class="search-input date input-small" value="{$start_time}" placeholder="请选择时间">
             <span>至</span>
             <input type="datetime" name="end_time" class="search-input date input-small" value="{$end_time}" placeholder="请选择时间">
             <span>用户名：</span>
             <input type="text" name="search_nickname" class="search-input input-small" value="{$search_nickname}" placeholder="输入用户名">
                    <php>$param['id'] = I('id');</php>
             <button type="button" class="sch-btn btn" href="javascript:;" url="{:U('sncode_lists', $param)}" id="search">搜索</button><a class="btn" href="{:U('export', $param)}">导出核销记录</a> </div>
        </form>
        
      </div>
      <!-- 数据列表 -->
      <div class="data-table">
        <div class="table-striped">
          <table cellspacing="1">
            <!-- 表头 -->
            <thead>
              <tr>
                <if condition="$check_all"><th class="row-selected row-selected"> <input type="checkbox" id="checkAll" class="check-all regular-checkbox"><label for="checkAll"></label></th></if>
                <volist name="list_grids" id="field">
                  <th <notempty name="field.width">style="width:{$field.width}px"</notempty> >{$field.title}</th>
                </volist>
              </tr>
            </thead>
            
            <!-- 列表 -->
            <tbody>
              <volist name="list_data" id="data">
                <tr>
                  <if condition="$check_all"><td><input class="ids regular-checkbox" type="checkbox" value="{$data['id']}" name="ids[]" id="check_{$data['id']}"><label for="check_{$data['id']}"></label></td></if>
                  <volist name="list_grids" id="grid">
                    <td>{$data[$key]}</td>
                  </volist>
                </tr>
              </volist>
            </tbody>
          </table>
        </div>
      </div>
      <div class="page"> {$_page|default=''} </div>
    </section>
  </div>
</block>
<block name="script"> 
  <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
  <php>if(C('COLOR_STYLE')=='blue_color') echo '
  <link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    ';</php>
  <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.js"></script> 
  <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script> 
  <script type="text/javascript">
$(function(){
    $('.date').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });		
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.muti_search').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');

        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }

		window.location.href = url;
	});

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

})
</script> 
</block>
